#include "keyEventFilter.h"

KeyEventFilter::KeyEventFilter()
{

}


bool KeyEventFilter::eventFilter(QObject *watched, QEvent *event){
    if(event->type() == QEvent::KeyPress){
        QKeyEvent *keyEvent = static_cast<QKeyEvent*>(event);
        switch (keyEvent->key()) {
        case Qt::Key_Control:
            emit ctrlPressed();

        }
    }
    if(event->type() == QEvent::KeyRelease){
        QKeyEvent *keyEvent = static_cast<QKeyEvent*>(event);
        switch (keyEvent->key()) {
        case Qt::Key_Control:
            emit ctrlReleased();

        }
    }
    return false;
}
